#ifndef _GLWIDGET_H
#define _GLWIDGET_H

#include <QtOpenGL/QGLWidget>

struct sVector{
  int x,
    y,
    z;
};

struct MousePosition{
  int iX,
    iY;
};

class GLWidget : public QGLWidget {

    Q_OBJECT // must include this if you use Qt signals/slots

public:
    GLWidget(sVector *vGyro, sVector *vAcc, sVector *vMag, QWidget *parent = NULL);

    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void wheelEvent(QWheelEvent *event);

    float fAngleX,
      fAngleY;
      //fAngleZ;
    int iTranslateZ;

    bool bDrag,
      bRotate;
    int iWindowWidth,
      iWindowHigh;

    sVector *vGyro,
      *vAcc,
      *vMag;

    MousePosition MouseLastPosition;
};


#endif  /* _GLWIDGET_H */